

{% block content %}

<style>
    .empty, .current, .day{
    border-style : solid;
    border-width : 1px;
    text-align: right;
    font-size: 12px;
    color: #2C2C2C;
    padding: 5px 5px 0 0;
}

</style>

<h2>Calendar of Gleaning Events</h2>
<h4>{{ mname }} {{ year }}

{% for entry in entries %}
    <br />
    <b>{{ entry }}</b>{{ entry.short|safe }}
{% endfor %}

</h4>
<div class="month">
    <table>

    <tr>
        <td class="empty">Mon</td>
        <td class="empty">Tue</td>
        <td class="empty">Wed</td>
        <td class="empty">Thu</td>
        <td class="empty">Fri</td>
        <td class="empty">Sat</td>
        <td class="empty">Sun</td>
    </tr>
	
    {% for week in month_days %}
        <tr>
        {% for day, entries, current in week %}

            <!-- TD style: empty | day | current; onClick handler and highlight -->  
            <td class= {% if day == 0 %}"empty"{% endif %}
            {% if day != 0 and not current %}"day"{% endif %}
            {% if day != 0 and current %}"current"{% endif %}
            {% if day != 0 %}
                onClick="parent.location='{% url cal.views.day year month day %}'"
                onMouseOver="this.bgColor='#eeeeee';"
                onMouseOut="this.bgColor='white';"
            {% endif %} >

		
            <!-- Day number and entry snippets -->
            {% if day != 0 %}
                {{ day }} <!--this prints the day number --> 
                <br> 
                {% for event in eventlst %}
                	{% if event.event_datetime.day == day %}
                		{{ event.farm.farm_name }}
                	{% endif %}
                {% endfor %}  
                {% for entry in entries %}
                    <br />
                    <b>{{ entry.name }}</b>{{ entry.short|safe }}
                {% endfor %}
                {% for entry in other_entries %}
                    <div class="entry">
                      {{ entry.short|safe }}<br />
                      {{ entry.body }}<br />
                    </div>
                {% endfor %}
                 <br />
            {% endif %}
            </td>
        {% endfor %}
        </tr>
    {% endfor %}
    </table>

    <div class="clear"></div>
</div>
<p>If you don't have an account, you can <a href="/accounts/register/">sign up</a> for one.
{% endblock %}
